package com.dispatcherFilter;

import javax.servlet.FilterConfig;
import javax.servlet.ServletException;

import org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter;
import org.hibernate.HibernateException;

import com.hibernate.HibernateUtil;


public class Struts2Dispatcher extends StrutsPrepareAndExecuteFilter {

	@Override
	public void init(FilterConfig filterConfig) throws ServletException {
		super.init(filterConfig);
		try {
			HibernateUtil.createSessionFactory();
			System.out.println("--------------- Hibernate demo application initializing successfully -----------------");
		} catch (HibernateException e) {
			throw new ServletException(e);
		}

	}

}
